<?php 
require_once '../include/includefiles.php';
require_once '../include/userislogin.php';
?>
<?php 
  $id = $_GET['id'];
  $query = "select * from `column` where id=".$id;
  $result = mysql_query($query) or die("查询栏目出错");
  $row = mysql_fetch_array($result);

  if($_POST['id']){
  	$id = $_POST['id'];
  	$colname = $_POST['colname'];
  	$query = "update `column` set name='".$colname."' where id = ".$id;
  	$result = mysql_query($query) or die("更新栏目失败");
  	if($result){
  		alertmsgrtn("修改栏目成功","column.php");
  	}
  }
  
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改栏目</title>
<style type="text/css">
<!--
.STYLE1 {
	font-size: 12px;
	font-weight: bold;
}
-->
</style>

<link href="images/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<form name="form1" method="post" action="">
  <input type="hidden" name="id" value="<?php echo $row['id'];?>"/>
  <table width="100%">
    <tr bgcolor="#E1E5EE">
      <td height="30" align="center"><span class="STYLE1">修改栏目</span></td>
    </tr>
    <tr align="center" bgcolor="#F7F8F9">
      <td height="30">栏目名称：
      <input name="colname" type="text" id="colname" value=<?php echo $row['name'];?>></td>
    </tr>
    <tr bgcolor="#F7F8F9">
      <td height="30" align="center"><input type="submit" name="Submit" value="确认">
          <input type="reset" name="Submit2" value="重置"></td>
    </tr>
  </table>
</form>
</body>
</html>
